# Make file for SciTE on Linux or compatible OS
# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed.
# This makefile assumes GCC 4.x is used and changes will be needed to use other compilers.
# GNU make does not like \r\n line endings so should be saved to CVS in binary form.

.SUFFIXES: .cxx .o .h .a .c
ifdef CLANG
CC = clang
CCOMP = clang
else
CC = g++
CCOMP = gcc
endif
AR = ar

# For the Gnome desktop stuff to work, prefix must point to where Gnome thinks it is.
CONFIGFLAGS:=$(shell pkg-config --cflags gtk+-2.0)
CONFIGLIB:=$(shell pkg-config --libs gtk+-2.0 gthread-2.0)
CONFIGTHREADS:=
gnomeprefix:=$(shell pkg-config --variable=prefix gtk+-2.0 2>/dev/null)
ifndef prefix
ifdef gnomeprefix
  prefix=$(gnomeprefix)
else
  prefix=/usr
endif
endif

# The two last install commands will fail if Gnome is not installed or is not at $(prefix).
# This is OK - just means no SciTE in the Gnome Applications menu
# Dead:	install -D SciTEGTK.properties $(SYSCONF_PATH)/SciTEGlobal.properties

SYSCONF_PATH=$(prefix)/share/scite

INSTALL=install

install:
	$(INSTALL) -m 755 -d $(DESTDIR)$(bindir) $(DESTDIR)$(SYSCONF_PATH)
	for files in ./*.properties ./*.api; \
	do \
		$(INSTALL) -m 644 $$files $(DESTDIR)$(SYSCONF_PATH); \
	done
	cp -r ./scite-debug $(DESTDIR)$(SYSCONF_PATH)/scite-debug
	cp ./lin/unix-spawner-ex.so $(DESTDIR)$(SYSCONF_PATH)/scite-debug/
	cp ./lin/dbgl.so $(DESTDIR)$(SYSCONF_PATH)/scite-debug/lua_clidebugger/


